/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package de.aeo.bll;

/**
 * @author Frederic Branczyk & Robert Piwonski
 */
public class Subject{
    
    private String name;
    private String abbreviation;
    private int minStudents;
    private int maxStudents;
    private int period;
    
    public Subject(String name, String abbreviation, int minStudents, 
                   int maxStudents, int period) {
        this.name = name;
        this.abbreviation = abbreviation;
        this.minStudents = minStudents;
        this.maxStudents = maxStudents;
        this.period = period;
    }
    
    public String getAbbreviation() {
        return abbreviation;
    }

    public void setAbbreviation(String abbreviation) {
        this.abbreviation = abbreviation;
    }

    public int getMaxStudents() {
        return maxStudents;
    }

    public void setMaxStudents(int maxStudents) {
        this.maxStudents = maxStudents;
    }

    public int getMinStudents() {
        return minStudents;
    }

    public void setMinStudents(int minStudents) {
        this.minStudents = minStudents;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getPeriod() {
        return period;
    }

    public void setPeriod(int period) {
        this.period = period;
    }
    
    public String getPeriodAbbreviation() {
        if (this.period==2) 
            return "2";
        else
            return "";
    }
    
    @Override
    public String toString() {
        if(this!=null)
            if(this.period==2)
                return this.name+" - "+this.abbreviation+this.period;
            else
                return this.name+" - "+this.abbreviation;
        else
            return "null";
    }

}